<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>{$meta_title}-狂雨小说CMS</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
        <link rel="stylesheet" href="__ADMIN__/css/admin.css">
    </head>
    <body>
    <div class="layui-fluid">
        <div class="layui-row">
            <div class="layui-col-md12">
                <form class="layui-form" action="{:url('sitemap')}">
                    <div class="layui-card">
                        <div class="layui-card-header">数据转换进度</div>
                        <div class="layui-card-body">
                            <div style="padding-bottom: 20px;">
                                <div class="layui-progress layui-progress-big" lay-filter="updata-progress" lay-showPercent="true">
                                    <div class="layui-progress-bar layui-bg-blue" lay-percent="0%"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-card">
                        <div class="layui-card-header">sitemap地址</div>
                        <div class="layui-card-body">
                            <textarea placeholder="sitemap地址" class="layui-textarea" id="filename"></textarea>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="__STATIC__/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="__ADMIN__/lib/layui/layui.js"></script>
    <script type="text/javascript" src="__ADMIN__/js/admin.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            function progress(url){
                $.getJSON(url,function(data){
                    if(data.code==1){
                        layui.use(['element'], function(){
                            layui.element.progress('updata-progress', (data.data.page/data.data.page_count)*100+'%');
                        });
                        if(data.data.complete===false){
                            progress(data.url);
                        }
                        var filename = $('#filename').val();
                        $('#filename').val(filename+data.data.filename+'\r\n');
                    }
                });
            }
            progress("{:url('sitemap_progress',['page_no'=>$Request.param.page_no,'page_num'=>$Request.param.page_num,'type'=>$Request.param.type])}");
        });
    </script>
    </body>
</html>